<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Vue 3</title>
</head>
<body>

<div id="app">

  <div>
    <table border="1" cellpadding="0" cellspacing="0" style="width: 80%">
      <tr>
        <td>序号</td>
        <td>图片</td>
        <td>标题</td>
        <td>作者</td>
        <td>分类</td>
        <td>时间</td>
      </tr>
      <tr v-for="(item,index) in news">
        <td>{{index + 1}}</td>
        <td><img :src="item.thumbnail_pic_s" width="50"></td>
        <td>{{item.title}}</td>
        <td>{{item.author_name}}</td>
        <td>{{item.category}}</td>
        <td>{{item.date}}</td>
      </tr>
    </table>
  </div>

</div>

<script src="js/vue.min.js"></script>
<script src="js/jquery-3.5.1.js"></script>
<script>

  var v = new Vue({
    el: '#app',
    data: {
      news: []
    },
    methods: {

    },
    // 页面创建完成自动触发 created
    created () {
      // 请求 php 读数据
      $.ajax({
        url: 'article.php',
        success: function (res) {
          // 将 JSON 字符串转为 JSON 对象
          res = JSON.parse(res);
          // 赋值到 articles 变量中
          v.news = res.data;
        }
      });
    }
  });

</script>
</body>
</html>